import math
# 定义最终输出的二进制结果
result = ""
user_num = input("请输入一个整数：")

if user_num.isdigit():
  num = int(user_num)
  while num > 0 :
    rem = num % 2               #余数
    num = math.floor(num / 2)   #商
    result = str(rem) + result
  if num == 0:
    result = "0"
  print(f"{user_num}转换之后的二进制数是{result}")
else:
  print("输入的不是正整数")




